<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    function Person(name, age) {
      this.name = name
      this.age = age
    }

    Person.prototype.eat = function() {
      console.log(this.name + ' 吃饭')
    }

    function Student(name, age, stuNo) {
      // Person.apply(this, arguments)
      Person.call(this, name, age)
      this.stuNo = stuNo
    }

    // Student.prototype = new Person()
    const p = Object.create(Person.prototype)
    console.log(p.__proto__ === Person.prototype)

    Student.prototype = p 
  </script>
</body>
</html>